<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<TTSoft.MyWeb.Models.ViewModels.GroupViewModel>" %>
<div class="AdminPageText">
List Of Thuoc
</div>
<table class="Grid" cellpadding="0" cellspacing="0">
	<thead>
		<tr>
            <th>HinhAnh</th>
			<th>TenThuoc</th>
            <th>NuocSanXuat</th>
			<th>HanDung</th>
			<th>NgaySanXuat</th>
			<th>SoLuong</th>
			<th>DonGia</th>
			<th></th>
			<th></th>
		<tr>
	</thead>
	<% for (int i=0; i<Model.ThuocModel.GetModel.LstObjModel.Count; i++){
		if (i % 2 != 0) {%>
		<tr class="Row" id="row-<%= Model.ThuocModel.GetModel.LstObjModel[i].ID %>">
		<% }
		else { %>
		<tr class="AlternatingRow" id="row-<%= Model.ThuocModel.GetModel.LstObjModel[i].ID %>">
		<% } %>
            <td><img src="../../../Content/Images/Items/<%= Model.ThuocModel.GetModel.LstObjModel[i].HinhAnh %>" width="60px" height="60px" /></td>
			<td><%= Model.ThuocModel.GetModel.LstObjModel[i].TenThuoc %></td>
            <td><%= Model.ThuocModel.GetModel.LstObjModel[i].NuocSanXuat %></td>
			<td><%= Model.ThuocModel.GetModel.LstObjModel[i].HanDung %></td>
			<td><%= String.Format("{0:dd/MM/yyyy}", Model.ThuocModel.GetModel.LstObjModel[i].NgaySanXuat) %></td>
			<td><%= Model.ThuocModel.GetModel.LstObjModel[i].SoLuong %></td>
			<td><%= String.Format("{0:#,##0;Nothing}", Model.ThuocModel.GetModel.LstObjModel[i].DonGia) %></td>
			<td>
				<a href="../../Admin/DetailOfThuoc?id=<%= Model.ThuocModel.GetModel.LstObjModel[i].ID %>">
					<span style="color: Blue; text-decoration: underline">Select</span>
				</a>
			</td>
			<td>
				<%= Ajax.ActionLink("Delete", "DeleteThuoc", "Admin", new { id = Model.ThuocModel.GetModel.LstObjModel[i].ID }, new AjaxOptions{Confirm = "Are you sure you want to Delete it? This action cannot be undone.", HttpMethod = "Delete", OnComplete = "jsonDelete_OnComplete"})%>
			</td>
		</tr>
	<% } %>  
</table>
<% GridPagerProperties properties = new GridPagerProperties()
	{
		PageSize = WebConfiguration.NumThuocPerPage,
		RecordCount = Model.ThuocModel.GetModel.TotalItem,
		CurrentPageIndex = Model.ThuocModel.GetModel.CurrentPage,
		TypeOfParam = EnumTypeOfParam.THUOC,
		TransferValue = Model.ThuocModel.ReferKeys.IDLoaiThuoc,
		ActionName = "SelectThuocByIDLoaiThuocPaging",
		Controller = "Admin",
		UpdateTargetId = "PartialDiv"
	};
%>
<%= Ajax.GridPager(properties)%>
